﻿using System.Collections.Generic;
using System.Web.Mvc;
using Orchard.ContentManagement;

namespace PlanetTelex.Coverflow.Models
{
    /// <summary>
    /// The content part model, uses the record class for storage.
    /// </summary>
    public class CoverflowPart : ContentPart<CoverflowRecord>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="CoverflowPart"/> class.
        /// </summary>
        public CoverflowPart()
        {
            AllMediaFolders = new List<SelectListItem>();
            Covers = new List<Cover>();
        }
        
        /// <summary>
        /// Gets or sets the base path for the covers.
        /// </summary>
        public string BasePath
        {
            get { return Record.BasePath; }
            set { Record.BasePath = value; }
        }

        /// <summary>
        /// Gets or sets the settings for the coverflow as a json string.
        /// </summary>
        public string SettingsJson
        {
            get { return Record.SettingsJson; }
            set { Record.SettingsJson = value; }
        }

        /// <summary>
        /// Gets or sets the selected media folder, used on the editor which uses this class as the view model.
        /// </summary>
        public string SelectedMediaFolder { get; set; }

        /// <summary>
        /// Gets or sets the root media folder, used on the editor which uses this class as the view model.
        /// </summary>
        public string RootMediaUrl { get; set; }

        /// <summary>
        /// Gets or sets all media folders, used on the editor which uses this class as the view model.
        /// </summary>
        public IEnumerable<SelectListItem> AllMediaFolders { get; set; }

        /// <summary>
        /// Gets or sets all covers, used on the editor preview which uses this class as the view model.
        /// </summary>
        public List<Cover> Covers { get; set; }
    }
}
